from greenlet import greenlet


def func1():
    print(1)
    g2.switch()
    print(2)
    g2.switch()


def func2():
    print(3)
    g1.switch()
    print(4)
    g1.switch()


g1 = greenlet(func1)
g2 = greenlet(func2)

g1.switch()
